import 'package:flutter/material.dart';
import "package:get/get.dart";

class ReleaseDetails extends StatefulWidget {
  const ReleaseDetails({super.key});
  @override
  State<ReleaseDetails> createState() => _HomePageState();
}

class _HomePageState extends State<ReleaseDetails>
    with SingleTickerProviderStateMixin {
  late TabController _tabController;
  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: 3, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          backgroundColor: Color(0xffffffff),
          centerTitle: true,
          leadingWidth: 40,
          title: Text('任务明细'),
          leading: IconButton(
            onPressed: () {
              Get.back();
              print('object');
            },
            icon: Image.asset('static/images/back.png'),
          ),
        ),
        body: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Container(
              margin: EdgeInsets.symmetric(horizontal: 15, vertical: 15),
              padding: EdgeInsets.all(10),
              decoration: BoxDecoration(
                  border: Border.all(color: Color(0XFFDDDDDD)),
                  borderRadius: BorderRadius.circular(10)),
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  ClipRRect(
                    borderRadius: BorderRadius.circular(7), // 设置圆角大小
                    child: Image.asset(
                      'static/aaa.png',
                      width: 60,
                      height: 80,
                      fit: BoxFit.fill,
                    ),
                  ),
                  Expanded(
                      child: Padding(
                    padding: EdgeInsets.symmetric(horizontal: 10),
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text(
                          '策划人要拥有的14张推要拥有的14张要拥有的14张广排期表！高',
                          style: TextStyle(
                            fontSize: 14,
                            fontWeight: FontWeight.bold,
                            overflow: TextOverflow.ellipsis,
                          ),
                        ),
                        Text(
                          '日期：10.23 12:22 -12.02 12:22',
                          style: TextStyle(
                            fontSize: 12,
                          ),
                        ),
                        Text(
                          '奖励：233ST',
                          style: TextStyle(
                            fontSize: 12,
                          ),
                        ),
                        Text(
                          '奖励：233ST',
                          style: TextStyle(
                            fontSize: 12,
                          ),
                        ),
                        Text(
                          '奖励：233ST',
                          style: TextStyle(
                            fontSize: 12,
                          ),
                        ),
                        Text(
                          '奖励：233ST',
                          style: TextStyle(
                            fontSize: 12,
                          ),
                        ),
                        Align(
                            alignment: Alignment.centerRight,
                            child: Container(
                              alignment: Alignment.center,
                              width: 80,
                              height: 32,
                              decoration: BoxDecoration(
                                  borderRadius: BorderRadius.circular((32)),
                                  color: Color(0XFFF5F5F5)),
                              child: GestureDetector(
                                  onTap: () => {},
                                  child: Row(
                                    mainAxisAlignment: MainAxisAlignment.center,
                                    children: [
                                      Text(
                                        '任务详情 ',
                                        style: TextStyle(
                                          fontSize: 12,
                                        ),
                                      ),
                                      Image.asset(
                                        'static/images/right.png',
                                        width: 5,
                                        fit: BoxFit.fitWidth,
                                      )
                                    ],
                                  )),
                            ))
                      ],
                    ),
                  )),
                ],
              ),
            ),
            Container(
              width: 250,
              child: TabBar(
                  indicatorWeight: 3.0,
                  labelPadding: EdgeInsets.symmetric(vertical: 5),
                  indicatorSize: TabBarIndicatorSize.tab,
                  indicatorPadding: EdgeInsets.only(right: 33, left: 33),
                  labelColor: Color(0xff333333),
                  unselectedLabelColor: Color(0xff999999),
                  dividerColor: Colors.transparent,
                  controller: _tabController,
                  overlayColor: WidgetStateProperty.all(Colors.transparent),
                  tabs: [
                    Text(
                      '待审核(34)',
                      style: TextStyle(fontSize: 12),
                    ),
                    Text(
                      '已通过(34)',
                      style: TextStyle(fontSize: 12),
                    ),
                    Text(
                      '已拒绝',
                      style: TextStyle(fontSize: 12),
                    ),
                  ]),
            ),
            Expanded(
              child: ListView(
                children: [
                  GestureDetector(
                    onTap: ()=>{
                      Get.toNamed('/talk/review_detail')
                    },
                    child: Container(
                        margin:
                            EdgeInsets.symmetric(horizontal: 15, vertical: 15),
                        padding: EdgeInsets.all(10),
                        decoration: BoxDecoration(
                            border: Border.all(color: Color(0XFFDDDDDD)),
                            borderRadius: BorderRadius.circular(10)),
                        child: Expanded(
                          child: Row(
                            children: [
                              ClipRRect(
                                borderRadius:
                                    BorderRadius.circular(25), // 设置圆角大小
                                child: Image.asset(
                                  'static/aaa.png',
                                  width: 25,
                                  height: 25,
                                  fit: BoxFit.fill,
                                ),
                              ),
                              SizedBox(
                                width: 10,
                              ),
                              Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  Text(
                                    '策划人要拥',
                                    style: TextStyle(
                                      fontSize: 14,
                                      fontWeight: FontWeight.bold,
                                      overflow: TextOverflow.ellipsis,
                                    ),
                                  ),
                                  Text(
                                    '奖励：233ST',
                                    style: TextStyle(
                                        fontSize: 12, color: Color(0XFF999999)),
                                  ),
                                ],
                              ),
                              Expanded(child: SizedBox()),
                              Text(
                                '待审核',
                                style: TextStyle(
                                    fontSize: 12, color: Color(0XFF999999)),
                              ),
                              SizedBox(
                                width: 5,
                              ),
                              Image.asset(
                                'static/images/right.png',
                                width: 5,
                                fit: BoxFit.fitWidth,
                              )
                            ],
                          ),
                        )),
                  )
                ],
              ),
            ),
          ],
        ));
  }
}
